﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using MySql.Data.MySqlClient;

namespace Trinity_Database_Handler
{
    public partial class Form2 : Form
    {
        public Form2(string Username, string Password, string Hostname, string Worlddb)
        {
            InitializeComponent();
            username.Hide();
            password.Hide();
            worlddb.Hide();
            hostname.Hide();
            username.Text = Username;
            password.Text = Password;
            worlddb.Text = Worlddb;
            hostname.Text = Hostname;
        }
        private void Form2_Load(object sender, EventArgs e)
        {
        }

        private void deleteServerinfoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (System.IO.File.Exists("serverinfo.txt")) {//Delete serverinfo file if exists
                System.IO.File.Delete("serverinfo.txt");
            }
            MessageBox.Show("Serverinfo was succesfully deleted");
        }

        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult result1 = MessageBox.Show("Are you sure you want to exit?", "Exit", MessageBoxButtons.YesNo);
            if (result1 == DialogResult.Yes){ //If chosen yes
                this.Close();
                Application.Exit(); // Close program
            }


        }

        private void changeDatabaseToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Close();
            Form form1 = new Form1();
            form1.Show();
        }



        private void button2_Click(object sender, EventArgs e)
        {
            //Open http://wow-v.com/displayid-finder-mobs.php with the webbrowser
            System.Diagnostics.ProcessStartInfo
            procFormsBuilderStartInfo = new System.Diagnostics.ProcessStartInfo();
            procFormsBuilderStartInfo.FileName = "http://wow-v.com/displayid-finder-mobs.php";
            procFormsBuilderStartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Maximized;
            System.Diagnostics.Process procFormsBuilder = new System.Diagnostics.Process();
            procFormsBuilder.StartInfo = procFormsBuilderStartInfo;
            procFormsBuilder.Start();
        }




    }
}
